//###############
//FILE : FileInitSession.java
//WRITER : Daniel Lowengrub, daniel_i_l, 320687098
//EXERCISE : oop ex3 2011
//DESCRIPTION:
//See below
//###############
package oop.ex3.protocol.sessions;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import oop.ex3.exceptions.InvalidMessageException;

/**
 * Send a NS the list of NS and files it contains. This should be run whenever a FM is started.
 * @author daniel
 */
public class FileInitSession extends FileToNameSession{

	/**
	 * Create a new session.
	 */
    public FileInitSession() {
        super();
    }

    @Override
    protected boolean specExecuteSession(DataInputStream inputStream,
            DataOutputStream outputStream) throws IOException, InvalidMessageException {


        if (!initSession(inputStream, outputStream))
            return false;

        if (!endSession(inputStream, outputStream))
            return false;

        return true;
    }

}
